package com.wiloon.java8x.http;

/**
 * Created with IntelliJ IDEA.
 * User: wiloon
 * Date: 6/24/12
 * Time: 5:40 PM
 */

import java.net.URL;
import java.io.*;
import javax.net.ssl.HttpsURLConnection;

public class JavaHttpsExample {
    public static void main(String[] args)
            throws Exception {
        String httpsURL = "https://www.google.com";
        URL myurl = new URL(httpsURL);
        HttpsURLConnection con = (HttpsURLConnection) myurl.openConnection();
        InputStream ins = con.getInputStream();
        InputStreamReader isr = new InputStreamReader(ins);
        BufferedReader in = new BufferedReader(isr);

        String inputLine;

        while ((inputLine = in.readLine()) != null) {
            System.out.println(inputLine);
        }

        in.close();
    }
}